package com.ywb.adapter.classadpter;

/**
 * @Author ywb
 */
public class VoltageAdapter implements IVoltage5V{
    public Voltage220V voltage220V;
    public VoltageAdapter(Voltage220V v){
        voltage220V = v;
    }

    @Override
    public int output() {
        if(voltage220V == null){
            System.out.println("请先输入src适配者");
            return 0;
        }
        int src = voltage220V.output();
        if(src == 5){
            return src;
        }
//        适配过程
        int dest = src / 44;

        System.out.println("适配完成");
        return dest;
    }
}
